package com.atguigu.gulimall.ware.dao;

import com.atguigu.common.to.mq.StockDetailTo;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;
import com.atguigu.gulimall.ware.entity.vo.SkuHasStockVo;
import com.atguigu.gulimall.ware.vo.OrderItemVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author xiong
 * @email 574646166@qq.com
 * @date 2021-06-25 10:09:26
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    List<SkuHasStockVo> getSkuHasStock(@Param("skuIds") List<Long> skuIds);

    List<Long> listWareIdHasStock(@Param("skuId") Long skuId);

    Long lockStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);

    void releaseLockedStock(@Param("stockDetailTo") StockDetailTo stockDetailTo);
}
